package cn.xiaopengstack.api.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author jiangyangang
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder

public class HomePageResponseDTO implements Serializable {

    private Activity activity;

    /**
     * 商品信息
     */
    private Goods goods;

    /**
     * 拼团统计信息
     */
    private TeamStatistic teamStatistic;

    /**
     * 拼团队伍信息
     */
    private List<Team> teamList;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static class Goods implements Serializable{
        private String goodsId;

        private BigDecimal originalPrice;

        private BigDecimal deductionPrice;

        private BigDecimal payPrice;

        private String goodsName;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder

    public static class TeamStatistic implements Serializable{

        /**
         * 开团队伍数量
         */
        private Integer allTeamCount;

        /**
         *
         * 成团队伍数量
         */
        private Integer allTeamCompleteCount;

        /**
         * 参团总数量
         */
        private Integer allTeamUserCount;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder

    public static class Team implements Serializable{
        /**
         * 拼团ID
         */
        private String teamId;
        /**
         * 拼团队伍名字
         */
        private String teamName;

        /**
         * 拼团结束时间
         */
        private Long groupBuyEndTime;
        /**
         * 拼团结束时间
         */
        private Long groupBuyStartTime;

        /**
         * 拼团剩余时间
         */
        private Long groupBuyEndLeftTime;

        /**
         * 拼团目标数量
         */
        private Integer targetCount;

        /**
         * 拼单完成数量
         */
        private Integer completeCount;

        /**
         * 锁单数量
         */
        private Integer lockCount;

    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static class Activity implements Serializable{
        private Long activityId;
    }
}
